import re


class Well:
    def __init__(self, sel, inse):
        self.sel = sel
        self.inse = inse

    def select(self):
        if self.select1() in ("重"):
            if self.selectNum() in "600":
                if self.selectSand() in ("砂石"):
                    return 75
                elif self.selectSand() in ("混凝土"):
                    return 76
                elif self.selectSand() in ("柏油"):
                    return 77
            elif self.selectNum() in "900":
                if self.selectdading() in ("大顶"):
                    if self.selectSand() in ("砂石"):
                        return 81
                    elif self.selectSand() in ("混凝土"):
                        return 82
                    elif self.selectSand() in ("柏油"):
                        return 83
                elif self.selectdading() in ("普通"):
                    if self.selectSand() in ("砂石"):
                        return 78
                    elif self.selectSand() in ("混凝土"):
                        return 79
                    elif self.selectSand() in ("柏油"):
                        return 80
                elif self.selectNum() in "1500":
                    return 84
        elif self.select1() in ("新"):
            if self.selectNum() in "600":
                if self.select2() in ("钢纤维"):
                    if self.selectSand() in ("砂石"):
                        return 91
                    elif self.selectSand() in ("混凝土"):
                        return 92
                    elif self.selectSand() in ("柏油"):
                        return 93
                elif self.select2() in ("复合"):
                    if self.selectSand() in ("砂石"):
                        return 85
                    elif self.selectSand() in ("混凝土"):
                        return 86
                    elif self.selectSand() in ("柏油"):
                        return 87
            elif self.selectNum() in "900":
                if self.select2() in ("钢纤维"):
                    if self.selectSand() in ("砂石"):
                        return 94
                    elif self.selectSand() in ("混凝土"):
                        return 95
                    elif self.selectSand() in ("柏油"):
                        return 96
                elif self.select2() in ("复合"):
                    if self.selectSand() in ("砂石"):
                        return 88
                    elif self.selectSand() in ("混凝土"):
                        return 89
                    elif self.selectSand() in ("柏油"):
                        return 90
        elif self.select1() in ("修", "换"):
            if self.select2() in ("钢纤维"):
                if self.selectNum() in "600":
                    if self.select5() in ("只"):
                        return 134
                    elif self.select5() in ("套"):
                        return 135
                elif self.selectNum() in "700":
                    if self.select5() in ("只"):
                        return 136
                    elif self.select5() in ("套"):
                        return 137
                elif self.selectNum() in "730,800,900,1000":
                    if self.select5() in ("只"):
                        return 138
                    elif self.select5() in ("套"):
                        return 139
            elif self.select2() in ("复合"):
                if self.select3() in ("轻"):
                    if self.select5() in ("只"):
                        if self.selectNum() in "500":
                            return 117
                        elif self.selectNum() in "600":
                            return 121
                        elif self.selectNum() in "700":
                            return 125
                        elif self.selectNum() in "900":
                            pass
                    elif self.select5() in ("套"):
                        if self.selectNum() in "500":
                            return 118
                        elif self.selectNum() in "600":
                            return 122
                        elif self.selectNum() in "700":
                            return 126
                        elif self.selectNum() in "730":
                            return 129
                elif self.select3() in ("重"):
                    if self.select5() in ("只"):
                        if self.selectNum() in "500":
                            return 119
                        elif self.selectNum() in "600":
                            return 123
                        elif self.selectNum() in "700":
                            return 127
                        elif self.selectNum() in "900":
                            pass
                    elif self.select5() in ("套"):
                        if self.selectNum() in "500":
                            return 120
                        elif self.selectNum() in "600":
                            return 124
                        elif self.selectNum() in "700":
                            return 128
                        elif self.selectNum() in "730":
                            return 130
                        elif self.selectNum() in "1000":
                            return 116
                        elif self.selectNum() in "1200":
                            return 112

    """判断井宽"""

    def selectNum(self):
        try:
            sel = re.findall("500|600|700|730|900|1000|1200|1500", self.inse)[0]
            return sel
        except:
            print("轻填写井的大小规格")

    """是否含有大顶"""

    def selectdading(self):
        try:
            sel = re.findall("大顶", self.inse)[0]
            return sel
        except:
            return "普通"

    """判断地面是砂石混凝土还是柏油"""

    def selectSand(self):
        try:
            sel = re.findall("砂石|混凝土|柏油", self.inse)[0]
            return sel
        except:
            return "砂石"

    """判断新建还是修复"""

    def select1(self):
        try:
            sel = re.findall("[新重修换]", self.inse)[0]
            return sel
        except:
            return "修"

    """判断是否钢纤维井盖"""

    def select2(self):
        try:
            sel = re.findall("钢纤维|复合", self.inse)[0]
            return sel
        except:
            return "复合"

    """判断是否加厚井盖"""

    def select3(self):
        try:
            sel = re.findall("[轻重]", self.inse)[0]
            return sel
        except:
            return "重"

    """判断是否未更换以及是否成套"""

    def select5(self):
        try:
            sel = re.findall("[只套]", self.inse)[0]
            return sel
        except:
            return

    def getWell(self):
        return self.select()
